<!-- Nav -->
<widget tag="nav" id="nav1" class="navbar fixed-top navbar-expand-lg bg-body-tertiary">
    <div class="container">
        <a class="navbar-brand" href="{:cmf_lang_url('','/')}">{$widget.vars.company_name|default='ThinkCMF'}</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                <php>$_nav_id=empty($widget['vars']['nav_id'])?0:$widget['vars']['nav_id'];</php>
                <navigation nav-id="$_nav_id" root="" id="main-navigation" class="nav navbar-nav navbar-nav-custom"
                            max-level="0">
                    <navigationMenu>
                        <if condition="$level gt 1">
                            <li class="nav-item menu-item menu-item-level-{$level} levelgt1">
                                <a class="dropdown-item" href="{$menu.href|default=''}"
                                   target="{$menu.target|default=''}">
                                    {$menu.name|default=''}
                                </a>
                            </li>
                            <else/>
                            <li class="nav-item menu-item menu-item-level-{$level}">
                                <a class="nav-link" href="{$menu.href|default=''}" target="{$menu.target|default=''}">
                                    {$menu.name|default=''}
                                </a>
                            </li>
                        </if>
                    </navigationMenu>
                    <navigationFolder root="li"
                                      class="nav-item dropdown dropdown-custom dropdown-custom-level-{$level}"
                                      dropdown="ul"
                                      dropdown-class="dropdown-menu dropdown-menu-level-{$level}">
                        <a href="#" class="nav-link dropdown-toggle dropdown-toggle-{$level}" role="button"
                           data-bs-toggle="dropdown" aria-expanded="false">
                            {$menu.name|default=''}<span class="caret"></span>
                        </a>
                    </navigationFolder>
                </navigation>

                <!--                <li class="nav-item dropdown">-->
                <!--                    <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">-->
                <!--                        Dropdown-->
                <!--                    </a>-->
                <!--                    <ul class="dropdown-menu">-->
                <!--                        <li><a class="dropdown-item" href="#">Action</a></li>-->
                <!--                        <li><a class="dropdown-item" href="#">Another action</a></li>-->
                <!--                        <li><hr class="dropdown-divider"></li>-->
                <!--                        <li><a class="dropdown-item" href="#">Something else here</a></li>-->
                <!--                    </ul>-->
                <!--                </li>-->
            </ul>

            <!--            <form class="d-flex" role="search">-->
            <!--                <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">-->
            <!--                <button class="btn btn-outline-success" type="submit">Search</button>-->
            <!--            </form>-->
            <if condition="cmf_home_multi_lang()">
                <php>
                    $allow_lang_list=cmf_allow_lang_list();
                    $current_lang=cmf_current_home_lang();
                    $lang_setting=cmf_get_option('lang_setting');
                </php>
                <div class="dropdown">
                    <button class="btn btn-outline-success dropdown-toggle" type="button" data-bs-toggle="dropdown"
                            aria-expanded="false">
                        <notempty name="$lang_setting['allow_lang_list']">
                            <foreach name="$lang_setting['allow_lang_list']" item="lang">
                                <eq name="current_lang" value="$lang.lang">
                                    {$lang.name|default=$lang.lang}
                                    <php>break;</php>
                                </eq>
                            </foreach>
                        </notempty>
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-left">
                        <notempty name="$lang_setting['allow_lang_list']">
                            <foreach name="$lang_setting['allow_lang_list']" item="lang">
                                <if condition="in_array($lang.lang,$allow_lang_list)">
                                    <li>
                                        <a class="dropdown-item" href="{:cmf_lang_url($lang.lang)}">{$lang.name|default=$lang.lang}</a>
                                    </li>
                                </if>
                            </foreach>
                        </notempty>
                    </ul>
                </div>
            </if>
        </div>
    </div>
</widget>
